package c.a.a.d0.h0;

import com.huawei.hms.analytics.core.crypto.AesCipher.AesLen;
import g.e;
import g.h;
import g.s;
import java.io.Closeable;
import java.io.IOException;
import java.util.Arrays;

/* compiled from: JsonReader */
public abstract class c implements Closeable {
    public static final String[] e = new String[AesLen.ROOTKEY_COMPONET_LEN];
    public int a;
    public int[] b = new int[32];
    public String[] c = new String[32];
    public int[] d = new int[32];

    /* compiled from: JsonReader */
    public static final class a {
        public final String[] a;
        public final s b;

        public a(String[] strArr, s sVar) {
            this.a = strArr;
            this.b = sVar;
        }

        public static a a(String... strArr) {
            try {
                h[] hVarArr = new h[strArr.length];
                e eVar = new e();
                for (int i = 0; i < strArr.length; i++) {
                    String str = strArr[i];
                    String[] strArr2 = c.e;
                    eVar.B0(34);
                    int length = str.length();
                    int i2 = 0;
                    for (int i3 = 0; i3 < length; i3++) {
                        String str2;
                        char charAt = str.charAt(i3);
                        if (charAt < 128) {
                            str2 = strArr2[charAt];
                            if (str2 == null) {
                            }
                        } else if (charAt == 8232) {
                            str2 = "\\u2028";
                        } else if (charAt == 8233) {
                            str2 = "\\u2029";
                        } else {
                        }
                        if (i2 < i3) {
                            eVar.H0(str, i2, i3);
                        }
                        eVar.G0(str2);
                        i2 = i3 + 1;
                    }
                    if (i2 < length) {
                        eVar.H0(str, i2, length);
                    }
                    eVar.B0(34);
                    eVar.q0();
                    hVarArr[i] = eVar.v();
                }
                return new a((String[]) strArr.clone(), s.c(hVarArr));
            } catch (IOException e) {
                throw new AssertionError(e);
            }
        }
    }

    /* compiled from: JsonReader */
    public enum b {
        BEGIN_ARRAY,
        END_ARRAY,
        BEGIN_OBJECT,
        END_OBJECT,
        NAME,
        STRING,
        NUMBER,
        BOOLEAN,
        NULL,
        END_DOCUMENT
    }

    static {
        for (int i = 0; i <= 31; i++) {
            e[i] = String.format("\\u%04x", new Object[]{Integer.valueOf(i)});
        }
        String[] strArr = e;
        strArr[34] = "\\\"";
        strArr[92] = "\\\\";
        strArr[9] = "\\t";
        strArr[8] = "\\b";
        strArr[10] = "\\n";
        strArr[13] = "\\r";
        strArr[12] = "\\f";
    }

    public abstract int h0() throws IOException;

    public abstract void n() throws IOException;

    public abstract void o() throws IOException;

    public abstract void q() throws IOException;

    public abstract void r() throws IOException;

    public final String s() {
        int i = this.a;
        int[] iArr = this.b;
        String[] strArr = this.c;
        int[] iArr2 = this.d;
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append('$');
        for (int i2 = 0; i2 < i; i2++) {
            int i3 = iArr[i2];
            if (i3 == 1 || i3 == 2) {
                stringBuilder.append('[');
                stringBuilder.append(iArr2[i2]);
                stringBuilder.append(']');
            } else if (i3 == 3 || i3 == 4 || i3 == 5) {
                stringBuilder.append('.');
                if (strArr[i2] != null) {
                    stringBuilder.append(strArr[i2]);
                }
            }
        }
        return stringBuilder.toString();
    }

    public abstract String s0() throws IOException;

    public abstract boolean t() throws IOException;

    public abstract String t0() throws IOException;

    public abstract b u0() throws IOException;

    public abstract boolean v() throws IOException;

    public final void v0(int i) {
        int[] iArr;
        int i2 = this.a;
        int[] iArr2 = this.b;
        if (i2 == iArr2.length) {
            if (i2 != 256) {
                this.b = Arrays.copyOf(iArr2, iArr2.length * 2);
                String[] strArr = this.c;
                this.c = (String[]) Arrays.copyOf(strArr, strArr.length * 2);
                iArr = this.d;
                this.d = Arrays.copyOf(iArr, iArr.length * 2);
            } else {
                StringBuilder g = c.b.a.a.a.g("Nesting too deep at ");
                g.append(s());
                throw new a(g.toString());
            }
        }
        iArr = this.b;
        int i3 = this.a;
        this.a = i3 + 1;
        iArr[i3] = i;
    }

    public abstract double w() throws IOException;

    public abstract int w0(a aVar) throws IOException;

    public abstract void x0() throws IOException;

    public abstract void y0() throws IOException;

    public final b z0(String str) throws b {
        StringBuilder i = c.b.a.a.a.i(str, " at path ");
        i.append(s());
        throw new b(i.toString());
    }
}
